gtk4.git
4 years agox11: Use single GLX fbconfig and store it in the display
Benjamin Otte [Tue, 29 Jun 2021 20:10:48 +0000 (22:10 +0200)]
x11: Use single GLX fbconfig and store it in the display

This mirrors the code for the EGL config.

4 years agox11: Remove glx version check
Benjamin Otte [Tue, 29 Jun 2021 16:45:04 +0000 (18:45 +0200)]
x11: Remove glx version check

We only work with GLX >= 1.3 anyway, so don't explicitly check for it
and pretend to do something else that doesn't work otherwise.

4 years agox11: Remove unused struct member
Benjamin Otte [Tue, 29 Jun 2021 16:44:09 +0000 (18:44 +0200)]
x11: Remove unused struct member

We don't care if the GL context is direct at all.

4 years agoRevert "x11: Always fall back to GLX on NVIDIA"
Benjamin Otte [Tue, 15 Jun 2021 12:48:55 +0000 (14:48 +0200)]
Revert "x11: Always fall back to GLX on NVIDIA"

This reverts commit c35a6725b99722d91b0ed6580546c27c8f0849ba.

This approach doesn't work because if NVIDIA doesn't work for EGL, the
EGL implementation won't be provided by NVIDIA, so checking the vendor
doesn't work.

4 years agox11: Remove the dummy surface
Benjamin Otte [Sun, 13 Jun 2021 21:35:06 +0000 (23:35 +0200)]
x11: Remove the dummy surface

Instead, use the display's "leader surface" when no surface is required,
because we have it lying around.

Really, we want to use EGL_NO_SURFACE, but if that's not supported...

4 years agox11: Remove GdkVisual
Benjamin Otte [Sun, 13 Jun 2021 15:43:15 +0000 (17:43 +0200)]
x11: Remove GdkVisual

It's not used anymore.

4 years agox11: Rework Visual selection
Benjamin Otte [Sun, 13 Jun 2021 15:34:55 +0000 (17:34 +0200)]
x11: Rework Visual selection

Instead of going via GdkVisual, doing a preselection and letting the GL
initialization improve it, let the GL initialization pick an X Visual
directly using X Visual code directly.

The code should select the same visuals as before as it tries to apply
the same logic, but it's a rewrite, so I expect I messed something up.

4 years agoglx: Remove Visual cache
Benjamin Otte [Sat, 12 Jun 2021 09:13:22 +0000 (11:13 +0200)]
glx: Remove Visual cache

1. We're using EGL most of the time anyway, so if we wanted to cache
   things, we'd need to port it there.
2. Our GL handling is massively configurable, so determining when to use
   the cache and when not is a challenge.
3. It makes startup nondeterministic and depend on whether a GTK4 app
   has previously been started on this display and nobody thinks about
   that when debugging.
4. The only benefit of the caching is delaying GL initialization - which
   made sense in GTK3 where almost no app used GL but doesn't make sense
   in GTK4 where almost every app uses GL.

So unless I find a big benefit to reintroducing it, this cache will be
gone for good.

4 years agox11: Move GL init code into the GL context
Benjamin Otte [Sat, 12 Jun 2021 09:07:24 +0000 (11:07 +0200)]
x11: Move GL init code into the GL context

No functional changes, just shuffling code.

4 years agox11: Store the EGL surface in the GdkSurfaceX11
Benjamin Otte [Thu, 10 Jun 2021 21:10:22 +0000 (23:10 +0200)]
x11: Store the EGL surface in the GdkSurfaceX11

Avoids having to use private data, though the benefit is somewhat
limited as we still have to put the destructor in the egl code and can't
just put it in gdk_surface_x11_finalize().

4 years agox11: Store the EGL config in the display
Benjamin Otte [Wed, 9 Jun 2021 11:42:19 +0000 (13:42 +0200)]
x11: Store the EGL config in the display

We only have one config, because we use the same Visual everywhere.
Store this config in the GdkDisplayX11 struct for easy access.

Also do this on initialize, because if creating the config fails, we
want to switch to GLX instead of failing to do GL at all.

This also simplifies a lot of code as we can share Visual, Colormap, etc
across surfaces.

4 years agox11: Move the EGL display into the private struct
Benjamin Otte [Mon, 7 Jun 2021 12:30:29 +0000 (14:30 +0200)]
x11: Move the EGL display into the private struct

There's no need to use g_object_set_data() for it.

We can also stop caching it elsewhere because we know the display has
it.

And finally, we can remove the display->have_egl boolean and use
display->egl_display != NULL instead. We initialize the display at
startup, so that variable is the perfect indicator.

4 years agox11: Pass the display, not the screen
Benjamin Otte [Sun, 6 Jun 2021 17:56:35 +0000 (19:56 +0200)]
x11: Pass the display, not the screen

Screens are on their way out.

4 years agox11: Simplify code
Benjamin Otte [Sun, 6 Jun 2021 15:29:29 +0000 (17:29 +0200)]
x11: Simplify code

These variables were a lot more important in GTK3, but now we just want
to pass them through to X.

4 years agox11: Move function call
Benjamin Otte [Sun, 6 Jun 2021 15:18:16 +0000 (17:18 +0200)]
x11: Move function call

The GLX visual selection is GLX specific, so it can be handled by the GLX
code.

There should be no reordering here, the call was just moved.

4 years agoglx: Don't initialize GLX multiple times.
Benjamin Otte [Sun, 6 Jun 2021 15:14:31 +0000 (17:14 +0200)]
glx: Don't initialize GLX multiple times.

Either it is initialized or it isn't.

4 years agox11: Initialize GL at startup
Benjamin Otte [Sun, 6 Jun 2021 15:07:05 +0000 (17:07 +0200)]
x11: Initialize GL at startup

We need to initialize GL to select the Visual we are going to use for
all our Windows.

As the Visual needs to be known before we know if we are even gonna use
GL later, we can't avoid initializing it.

Note that this previously happened, too. It was just hidden behind the
GdkScreen initialization.

4 years agox11: Don't share cached GLX visuals with GTK3
Benjamin Otte [Thu, 3 Jun 2021 17:20:51 +0000 (19:20 +0200)]
x11: Don't share cached GLX visuals with GTK3

We don't want to bind ourselves to GTK3 - both because we don't want to
accidentally cause bugs in a different codebase and because we want to
deviate from it.

While doing so, also store visuals as visuals and not as integers.
And only store one Visual because GTK4 only uses one visual.

And then remove the code that is leftover for dealing with the
compatibility Visual for GTK3.

PS: I'm kinda proud of my STRINGIFY_WITHOUT_BRACKETS hack.

4 years agox11: Reorder code
Benjamin Otte [Thu, 3 Jun 2021 03:02:15 +0000 (05:02 +0200)]
x11: Reorder code

Initialize the GL visuals from gdkdisplay.c so the call into the GL
stack isn't hidden in gdkvisual.c

This is relevant for further commits.

4 years agox11: Stop reordering visuals
Benjamin Otte [Thu, 3 Jun 2021 02:54:37 +0000 (04:54 +0200)]
x11: Stop reordering visuals

The old code was ordering visuals by depth, but considering that these
days we either use the default visual or a 32bit RGBA visual, that
reordering does not have an effect anymore.

In theory, the only effect is that the GLX Visual selection might select
a different replacement Visual when it checks for improved GL Visuals, but
even there I can't come up with a case where that matters, because
again, the visuals are only reordered by depth and we want to keep the
depth.

In any case, make this a separate commit so bisecting can find this
problem if it ever shows up.

4 years agox11: Remove unused function
Benjamin Otte [Thu, 3 Jun 2021 02:45:36 +0000 (04:45 +0200)]
x11: Remove unused function

Now that we can't create extra GdkX11Screens anymore, this also means
that there is exactly 1 GdkX11Screen per GdkX11Display.

4 years agox11: Move code where it belongs
Benjamin Otte [Thu, 3 Jun 2021 02:42:23 +0000 (04:42 +0200)]
x11: Move code where it belongs

Instead of the display telling the screen to tell the visuals to tell
the display to initialize itself, just init the display directly.

What a concept.

4 years agobuild: Build demos before tools
Benjamin Otte [Mon, 7 Jun 2021 12:56:25 +0000 (14:56 +0200)]
build: Build demos before tools

That's a sneaky trick so my edit/compile/test cycle goes faster:
I usually use demos for testing so the tools don't have to be linked for
me to start testing.

4 years agoMerge branch 'destroy-pointer-gestures' into 'master'
Matthias Clasen [Wed, 21 Jul 2021 21:33:53 +0000 (21:33 +0000)]
Merge branch 'destroy-pointer-gestures' into 'master'

gdk/wayland: Clean up gestures if pointer capability is withdrawn

See merge request GNOME/gtk!3697

4 years agogdk/wayland: Clean up gestures if pointer capability is withdrawn
Vlad Zahorodnii [Tue, 22 Jun 2021 06:23:42 +0000 (09:23 +0300)]
gdk/wayland: Clean up gestures if pointer capability is withdrawn

If the pointer capability is added, pointer swipe and pinch gestures
will be created. However, if the pointer capability is removed, the
gesture objects won't be destroyed.

If the pointer capability is removed and added several times in a row,
for example due to plugging and unplugging physical mouse, this can lead
to leaking the old gesture objects.

In order to prevent that, this change makes the seat destroy swipe and
pinch gestures when the pointer capability is withdrawn.

4 years agoMerge branch 'sync-icons' into 'master'
Matthias Clasen [Wed, 21 Jul 2021 17:49:15 +0000 (17:49 +0000)]
Merge branch 'sync-icons' into 'master'

Sync included icons from adwaita-icon-theme

See merge request GNOME/gtk!3773

4 years agoSync included icons from adwaita-icon-theme
Matthias Clasen [Tue, 20 Jul 2021 21:18:06 +0000 (17:18 -0400)]
Sync included icons from adwaita-icon-theme

Make sure we stay in sync with the Adwaita.

4 years agoMerge branch 'wip/otte/build' into 'master'
Matthias Clasen [Tue, 20 Jul 2021 18:25:59 +0000 (18:25 +0000)]
Merge branch 'wip/otte/build' into 'master'

Streamline build configuration

See merge request GNOME/gtk!3391

4 years agox11: Remove XComposite
Benjamin Otte [Fri, 2 Apr 2021 01:05:40 +0000 (03:05 +0200)]
x11: Remove XComposite

It's only used during DND to allow use of the root window's cow window
as a DND target, because apparently gnome-shell used to think that was a
great idea to DND to the overview.

Somebody complain to gnome-shell devs about it not being a good idea if
they want it fixed.
Potentially using Wayland is a better idea though.

This reverts 85ae875dcbfcfa3fbdca857dc90467d39b9ff0c5

Related: https://bugzilla.gnome.org/show_bug.cgi?id=601731

4 years agox11: Remove unused headers
Benjamin Otte [Fri, 2 Apr 2021 00:52:49 +0000 (02:52 +0200)]
x11: Remove unused headers

4 years agobuild: Make all X11 extensions mandatory
Benjamin Otte [Fri, 2 Apr 2021 00:13:49 +0000 (02:13 +0200)]
build: Make all X11 extensions mandatory

It's not 2011 anymore, and we shouldn't randomly build one of 10.000
different combinations of X11 backends (I counted the possibilities) but
exactly the one we expect people to use.

4 years agobuild: Remove sassc option
Benjamin Otte [Thu, 1 Apr 2021 19:29:41 +0000 (21:29 +0200)]
build: Remove sassc option

Instead, ensure that sassc is made madatory on git builds (because
it is, we don't ship CSS files anymore) and not even looked for in
release builds (because do ship CSS files there).

4 years agobuild: disable Vulkan by default
Benjamin Otte [Thu, 1 Apr 2021 16:08:19 +0000 (18:08 +0200)]
build: disable Vulkan by default

We don't want people to build Vulkan support when they just want to get
GTK built.

This is in particular true for GTK as a CI subproject or for people
using jhbuild.

Worse, just having Vulkan support compiled in tends to cause crashes
in the Inspector, even if you are not using it.

4 years agobuild: Set proper defaults for media backends
Benjamin Otte [Thu, 1 Apr 2021 15:59:18 +0000 (17:59 +0200)]
build: Set proper defaults for media backends

GTK supports webm playback, which means a backend should always be
compiled.

The ffmpeg backend however is incomplete (no audio) and as such, we
don't want people to end up with it accidentally.

Since we don't want to drag an entire gstreamer build into our ci
on MacOs or msvc, explicitly disable the gstreame media backend there.

4 years agoMerge branch 'fix-dialog-docs' into 'master'
Matthias Clasen [Tue, 20 Jul 2021 12:54:55 +0000 (12:54 +0000)]
Merge branch 'fix-dialog-docs' into 'master'

gtk/builder: Port example to GTK 4

See merge request GNOME/gtk!3772

4 years agoUpdate Ukrainian translation
Yuri Chornoivan [Tue, 20 Jul 2021 12:08:13 +0000 (12:08 +0000)]
Update Ukrainian translation

4 years agogtk/builder: Port example to GTK 4
Maximiliano Sandoval R [Tue, 20 Jul 2021 11:15:57 +0000 (13:15 +0200)]
gtk/builder: Port example to GTK 4

4 years agoMerge branch 'tooltip-hig' into 'master'
Matthias Clasen [Tue, 20 Jul 2021 11:17:36 +0000 (11:17 +0000)]
Merge branch 'tooltip-hig' into 'master'

password_entry: Header Capitalization on tooltip

See merge request GNOME/gtk!3771

4 years agopassword_entry: Header Capitalization on tooltip
Maximiliano Sandoval R [Tue, 20 Jul 2021 11:00:05 +0000 (13:00 +0200)]
password_entry: Header Capitalization on tooltip

See https://teams.pages.gitlab.gnome.org/Design/hig-www/feedback/tooltips.html

4 years agoMerge branch 'win32.hidpi.cleanup' into 'master'
Matthias Clasen [Tue, 20 Jul 2021 02:43:43 +0000 (02:43 +0000)]
Merge branch 'win32.hidpi.cleanup' into 'master'

GDK-Win32: Clean up HiDPI support and WGL slightly

Closes #3796

See merge request GNOME/gtk!3767

4 years agoMerge branch 'ci-default-settings-4' into 'master'
Matthias Clasen [Mon, 19 Jul 2021 18:36:11 +0000 (18:36 +0000)]
Merge branch 'ci-default-settings-4' into 'master'

reftests: Enforce default settings

See merge request GNOME/gtk!3769

4 years agoreftests: Enforce default settings
Matthias Clasen [Mon, 19 Jul 2021 17:10:31 +0000 (13:10 -0400)]
reftests: Enforce default settings

Set all settings to their default values, so we
are less dependent on the environment to be set
up just right. In particular, this fixes animations
being disabled when we happen to run in a vm.

4 years agoGDK-Win32: Clean up HiDPI support and WGL a bit
Chun-wei Fan [Mon, 19 Jul 2021 10:20:09 +0000 (18:20 +0800)]
GDK-Win32: Clean up HiDPI support and WGL a bit

Make _gdk_win32_display_get_monitor_scale_factor() less complex, by:

*  Drop the preceding underscore.

*  Dropping an unused parameter.

*  Using a GdkSurface instead of a HWND, as the HWND that we pass into
   this function might have been taken from a GdkSurface, which are now
   always created with CS_OWNDC.  This means if a GdkSurface was passed
   in, we ensure that we only acquire the DC from the HWND once, and do
   not attempt to call ReleaseDC() on it.

*  Store the HDC that we acquire from the GdkSurface's HWND into the
   surface, and use that as the HDC we need for our GdkGLContext.

*  Drop the gl_hwnd from GdkWin32Display, as that is really should be
   stored in the GdkSurface.

*  For functions that were updated, name GdkWin32Display variables as
   display_win32 and GdkSurface variables as surface, to unify things.

*  Stop calling ReleaseDC() on the HDC that we use for OpenGL, since
   they were acquired from HWND's created with CS_OWNDC.

4 years agogdksurface-win32.c: Create all surfaces with CS_OWNDC
Chun-wei Fan [Mon, 19 Jul 2021 02:44:48 +0000 (10:44 +0800)]
gdksurface-win32.c: Create all surfaces with CS_OWNDC

We want to ensure that we have things set up properly for drag surfaces
as well.

4 years agoMerge branch 'pango-main' into 'master'
Matthias Clasen [Sat, 17 Jul 2021 13:05:42 +0000 (13:05 +0000)]
Merge branch 'pango-main' into 'master'

Use pango from the main branch

See merge request GNOME/gtk!3762

4 years agoUpdate Ukrainian translation
Yuri Chornoivan [Sat, 17 Jul 2021 05:34:21 +0000 (05:34 +0000)]
Update Ukrainian translation

4 years agoUse pango from the main branch
Matthias Clasen [Fri, 16 Jul 2021 17:19:22 +0000 (13:19 -0400)]
Use pango from the main branch

Change the Pango subproject to use the main branch.

This depends on
https://gitlab.gnome.org/GNOME/pango/-/merge_requests/379

4 years agoMerge branch 'wip/otte/for-master' into 'master'
Benjamin Otte [Fri, 16 Jul 2021 16:26:23 +0000 (16:26 +0000)]
Merge branch 'wip/otte/for-master' into 'master'

cssimagecrossfade: Don't abort() when failing to parse image

Closes #4101

See merge request GNOME/gtk!3758

4 years agocssimagecrossfade: Don't abort() when failing to parse image
Benjamin Otte [Fri, 16 Jul 2021 15:48:25 +0000 (17:48 +0200)]
cssimagecrossfade: Don't abort() when failing to parse image

The code wasn't checking if parsing an image failed and just returning
success.

Testcase from bug is attached.

Fixes #4101

4 years agoMerge branch 'fix-negative-scales' into 'master'
Matthias Clasen [Fri, 16 Jul 2021 11:59:47 +0000 (11:59 +0000)]
Merge branch 'fix-negative-scales' into 'master'

ngl: Handle negative scales

Closes #4096

See merge request GNOME/gtk!3755

4 years agoMerge branch 'metainfo' into 'master'
Matthias Clasen [Fri, 16 Jul 2021 11:14:09 +0000 (11:14 +0000)]
Merge branch 'metainfo' into 'master'

metadata: Fix license identifiers and appdata

See merge request GNOME/gtk!3757

4 years agotestsuite: Avoid negative scales with gl renderer
Matthias Clasen [Fri, 16 Jul 2021 11:11:20 +0000 (07:11 -0400)]
testsuite: Avoid negative scales with gl renderer

The fix in 1c90bb522e7e722b was only for the ngl renderer,
so don't use the test with the gl renderer, until it is
fixed as well.

4 years agoMerge branch 'wip/chergert/fix-texthistory-insert' into 'master'
Matthias Clasen [Fri, 16 Jul 2021 11:04:21 +0000 (11:04 +0000)]
Merge branch 'wip/chergert/fix-texthistory-insert' into 'master'

texthistory: fix calculation of n_chars

See merge request GNOME/gtk!3756

4 years agomeson: Use a valid SPDX identifier
Maximiliano Sandoval R [Fri, 16 Jul 2021 08:46:53 +0000 (10:46 +0200)]
meson: Use a valid SPDX identifier

See https://mesonbuild.com/Reference-manual.html#license

4 years agoappdata: Use launchable rather than id
Maximiliano Sandoval R [Fri, 16 Jul 2021 08:43:11 +0000 (10:43 +0200)]
appdata: Use launchable rather than id

<id> should be used for the component id and <launchable> for the
desktop file.

4 years agoappdata: Add content_rating
Maximiliano Sandoval R [Fri, 16 Jul 2021 08:41:40 +0000 (10:41 +0200)]
appdata: Add content_rating

https://www.freedesktop.org/software/appstream/docs/chap-Metadata.html#tag-content_rating

4 years agoappdata: Use correct SPDX license identifier
Maximiliano Sandoval R [Fri, 16 Jul 2021 08:34:25 +0000 (10:34 +0200)]
appdata: Use correct SPDX license identifier

Following
https://www.freedesktop.org/software/appstream/docs/chap-Metadata.html#tag-project_license,
for the complete list of identifiers see https://spdx.org/licenses/

4 years agotexthistory: fix calculation of n_chars
Christian Hergert [Fri, 16 Jul 2021 02:19:57 +0000 (19:19 -0700)]
texthistory: fix calculation of n_chars

This should be the number of characters, not the end position. This fixes
an issue where we wouldn't coalesce insert actions together.

4 years agotestsuite: Add test for crasher
Benjamin Otte [Thu, 15 Jul 2021 21:33:54 +0000 (23:33 +0200)]
testsuite: Add test for crasher

Test for the crasher in !4096

4 years agongl: Handle negative scales
Matthias Clasen [Thu, 15 Jul 2021 20:40:13 +0000 (16:40 -0400)]
ngl: Handle negative scales

Scale factors can be negative, but we were not
looking out for that, triggering an assertion when
trying to create a render target with negative
width of height. Avoid that.

Fixes: #4096
4 years agoMerge branch 'transparent-optimizations' into 'master'
Matthias Clasen [Thu, 15 Jul 2021 18:39:48 +0000 (18:39 +0000)]
Merge branch 'transparent-optimizations' into 'master'

snapshot: Handle transparent opacity nodes correctly

See merge request GNOME/gtk!3754

4 years agoMerge branch 'wip/baedert/for-master' into 'master'
Matthias Clasen [Thu, 15 Jul 2021 18:31:22 +0000 (18:31 +0000)]
Merge branch 'wip/baedert/for-master' into 'master'

snapshot: Replace trivial gradients with color nodes

See merge request GNOME/gtk!3753

4 years agongl: Do nothing for transparent text nodes
Matthias Clasen [Thu, 15 Jul 2021 17:17:17 +0000 (13:17 -0400)]
ngl: Do nothing for transparent text nodes

Like the previous commit - a transparent text node
will not produce any visible pixels, so bail out early.

4 years agongl: Do nothing for transparent color nodes
Matthias Clasen [Thu, 15 Jul 2021 17:16:37 +0000 (13:16 -0400)]
ngl: Do nothing for transparent color nodes

No need to send commands to the GPU to render transparency.

4 years agosnapshot: Handle transparent opacity nodes correctly
Matthias Clasen [Thu, 15 Jul 2021 17:14:13 +0000 (13:14 -0400)]
snapshot: Handle transparent opacity nodes correctly

Eliding totally transparent content from the node tree is
not 100% correct, since filters can make things visible, so
we need to at least preserve the bounds. We can do that by
creating a transparent color node.

4 years agosnapshot: Only compute start and end point if we have to
Timm Bäder [Thu, 15 Jul 2021 14:52:38 +0000 (16:52 +0200)]
snapshot: Only compute start and end point if we have to

If the linear gradient results in a color node, we don't need the start
and end point. Only declare and compute it if we need to.

4 years agosnapshot: Replace trivial gradients with color nodes
Timm Bäder [Thu, 15 Jul 2021 14:50:32 +0000 (16:50 +0200)]
snapshot: Replace trivial gradients with color nodes

Extend this to all existing gradient types

4 years agoMerge branch 'wip/otte/for-master' into 'master'
Benjamin Otte [Wed, 14 Jul 2021 18:46:36 +0000 (18:46 +0000)]
Merge branch 'wip/otte/for-master' into 'master'

rendernodeparser: Don't use %g when writing file

See merge request GNOME/gtk!3752

4 years agorendernodeparser: Remove leftover debug prints
Benjamin Otte [Wed, 14 Jul 2021 18:19:40 +0000 (20:19 +0200)]
rendernodeparser: Remove leftover debug prints

4 years agorendernodeparser: Don't use %g when writing file
Benjamin Otte [Wed, 14 Jul 2021 18:18:44 +0000 (20:18 +0200)]
rendernodeparser: Don't use %g when writing file

%g is locale dependent and can add "," where "." should be. Use
string_append_double() instead.

4 years agoMerge branch 'doc-fixes' into 'master'
Emmanuele Bassi [Tue, 13 Jul 2021 23:43:06 +0000 (23:43 +0000)]
Merge branch 'doc-fixes' into 'master'

doc: Syntax fixes

See merge request GNOME/gtk!3751

4 years agodoc: Syntax fixes
Marco Melorio [Tue, 13 Jul 2021 22:53:19 +0000 (22:53 +0000)]
doc: Syntax fixes

4 years agoMerge branch 'fp16-tests' into 'master'
Matthias Clasen [Tue, 13 Jul 2021 13:38:21 +0000 (13:38 +0000)]
Merge branch 'fp16-tests' into 'master'

ngl: Make the C half-float implementation accessible

See merge request GNOME/gtk!3748

4 years agotests: Add some fp16 tests
Matthias Clasen [Tue, 13 Jul 2021 13:02:16 +0000 (09:02 -0400)]
tests: Add some fp16 tests

4 years agongl: Make the C half-float implementation accessible
Matthias Clasen [Tue, 13 Jul 2021 13:02:35 +0000 (09:02 -0400)]
ngl: Make the C half-float implementation accessible

Make this accessible for tests.

4 years agoMerge branch 'gi-fixes' into 'master'
Emmanuele Bassi [Tue, 13 Jul 2021 11:21:20 +0000 (11:21 +0000)]
Merge branch 'gi-fixes' into 'master'

Various introspection fixes

See merge request GNOME/gtk!3747

4 years agogtk: fix GtkPasswordEntryBuffer introspection
Marc-André Lureau [Tue, 13 Jul 2021 11:03:03 +0000 (15:03 +0400)]
gtk: fix GtkPasswordEntryBuffer introspection

Move the source file to public_sources list, and fix tag annotation.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
4 years agoAdd GtkMenuButton:primary Since: annotation
Marc-André Lureau [Tue, 13 Jul 2021 07:31:00 +0000 (11:31 +0400)]
Add GtkMenuButton:primary Since: annotation

Property added in commit a74420bc1a501f6ee951ed152e8f9a941b0c8438.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
4 years agoAdd GTK_DEBUG_ICONFALLBACK Since: 4.2 annotation
Marc-André Lureau [Tue, 13 Jul 2021 07:26:37 +0000 (11:26 +0400)]
Add GTK_DEBUG_ICONFALLBACK Since: 4.2 annotation

Introduced in commit 6f8240805617c2c772c4d298dc692ac831d22013.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
4 years agoUpdate Brazilian Portuguese translation
Rafael Fontenelle [Sat, 10 Jul 2021 19:29:56 +0000 (19:29 +0000)]
Update Brazilian Portuguese translation

(cherry picked from commit c7a7fc4de64e830bc5a67edad3fea10df67f668c)

4 years agoUpdate Brazilian Portuguese translation
Rafael Fontenelle [Sat, 10 Jul 2021 17:13:59 +0000 (17:13 +0000)]
Update Brazilian Portuguese translation

(cherry picked from commit 72c3026764fce622dcef4b51cee75eec44870a55)

4 years agoMerge branch 'activatable-buttons' into 'master'
Matthias Clasen [Sat, 10 Jul 2021 12:59:39 +0000 (12:59 +0000)]
Merge branch 'activatable-buttons' into 'master'

menubutton: Make menu buttons activatable again

Closes #4079

See merge request GNOME/gtk!3728

4 years agoMerge branch 'wip/chergert/fix-4094' into 'master'
Matthias Clasen [Fri, 9 Jul 2021 19:29:41 +0000 (19:29 +0000)]
Merge branch 'wip/chergert/fix-4094' into 'master'

joinedmenu: add helper to join menus instead of nesting

Closes #4094

See merge request GNOME/gtk!3739

4 years agoMerge branch 'gdkkeys-m' into 'master'
Matthias Clasen [Fri, 9 Jul 2021 10:58:23 +0000 (10:58 +0000)]
Merge branch 'gdkkeys-m' into 'master'

[master] gdkkeys-win32.c: fix initialisation of key_state in update_keymap

See merge request GNOME/gtk!3742

4 years agoMerge branch 'dynamic-typelib-path' into 'master'
Matthias Clasen [Fri, 9 Jul 2021 10:57:37 +0000 (10:57 +0000)]
Merge branch 'dynamic-typelib-path' into 'master'

build: Get typelib dir dynamically using gobject-introspection dependency

See merge request GNOME/gtk!3737

4 years agoMerge branch 'invisible-char-fix' into 'master'
Matthias Clasen [Fri, 9 Jul 2021 10:56:51 +0000 (10:56 +0000)]
Merge branch 'invisible-char-fix' into 'master'

textbtree: Initialize to zero the tags counting array

See merge request GNOME/gtk!3740

4 years agogdkkeys-win32.c: fix initialisation of key_state in update_keymap
Jeremy Tan [Fri, 9 Jul 2021 04:35:44 +0000 (12:35 +0800)]
gdkkeys-win32.c: fix initialisation of key_state in update_keymap

It apparently worked by chance in the past, but now causes e.g.
alphanumeric characters to be interpreted as half-width katakana
when using the Japanese IME.

4 years agotextbtree: Initialize to zero the tags counting array
Marco Trevisan (Treviño) [Fri, 9 Jul 2021 01:34:40 +0000 (03:34 +0200)]
textbtree: Initialize to zero the tags counting array

We're using the tag contents array to count the number of invisible tags
set but we always increase it without being initialized.

This may lead to unexpected behavior when traversing them and it's
causing a reliable failure in the textiter tests under s390x.

So, memset that area content to 0 once allocated. It's not needed to do
the same for the tags themselves as we always assign them.

 Conditional jump or move depends on uninitialised value(s)
   at 0x4CFAA00: _gtk_text_btree_char_is_invisible (gtktextbtree.c:2569)
   by 0x4B8A1BB: find_visible_by_log_attrs (gtktextiter.c:3244)
   by 0x10E93D: check_backward_visible_word_start (textiter.c:484)
   by 0x10E93D: test_visible_word_boundaries (textiter.c:523)
   by 0x533288F: g_test_run_suite (in /usr/lib/s390x-linux-gnu/libglib-2.0.so.0)
   by 0x53328E7: g_test_run (in /usr/lib/s390x-linux-gnu/libglib-2.0.so.0)
   by 0x109CC1: main (textiter.c:807)

4 years agojoinedmenu: add helper to join menus instead of nesting
Christian Hergert [Thu, 8 Jul 2021 21:16:06 +0000 (14:16 -0700)]
joinedmenu: add helper to join menus instead of nesting

In many cases, we have an "extra-menu" property that is used to allow
applications to join menus into the native menu for the widget. Previously,
this was done by nesting that menu in a section.

Doing so increases the complexity of the rules for GtkMenuTracker as you
may want different handling from inside of the section vs toplevel
sections.

If instead we synthetically glue the menus together, we have a much more
natural joining of menus as the application developer would expect for
their menu.

This also ports GtkLabel, GtkText, GtkPasswordEntry, and GtkTextView to
use the joined menu helper.

The joined menu helper comes originally from GNOME Builder and has had
extensive use there.

Fixes #4094

4 years agobuild: Get typelib dir dynamically using gobject-introspection dependency
Marco Trevisan (Treviño) [Thu, 8 Jul 2021 02:33:16 +0000 (04:33 +0200)]
build: Get typelib dir dynamically using gobject-introspection dependency

We hardcoded the typelib directory for only an arch (and a distro),
while we can just get it from gobject-introspection pkg config if tests
are enabled.

4 years agoMerge branch 'wip/exalm/scroll-touch' into 'master'
Matthias Clasen [Wed, 7 Jul 2021 21:37:58 +0000 (21:37 +0000)]
Merge branch 'wip/exalm/scroll-touch' into 'master'

scrolledwindow: Don't check drag threshold when already scrolling

See merge request GNOME/gtk!3735

4 years agoMerge branch 'text-cursor-extents' into 'master'
Matthias Clasen [Wed, 7 Jul 2021 21:37:14 +0000 (21:37 +0000)]
Merge branch 'text-cursor-extents' into 'master'

text: Add API to compute cursor extents

See merge request GNOME/gtk!3734

4 years agoMerge branch 'wl-since' into 'master'
Matthias Clasen [Wed, 7 Jul 2021 21:36:13 +0000 (21:36 +0000)]
Merge branch 'wl-since' into 'master'

Add missing "Since: 4.X" doc tags

See merge request GNOME/gtk!3736

4 years agoAdd missing "Since: 4.X" tags
Marc-André Lureau [Wed, 7 Jul 2021 16:18:28 +0000 (20:18 +0400)]
Add missing "Since: 4.X" tags

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
4 years agotext: Add API to compute cursor extents
Florian Müllner [Tue, 6 Jul 2021 20:39:05 +0000 (22:39 +0200)]
text: Add API to compute cursor extents

The extents that correspond to the strong/weak cursor at a given
character position can be used for example to point a popover to
text in the widget.

4 years agoscrolledwindow: Don't check drag threshold when already scrolling
Alexander Mikhaylenko [Wed, 7 Jul 2021 14:39:06 +0000 (19:39 +0500)]
scrolledwindow: Don't check drag threshold when already scrolling

Checkout the drag threshold only makes sense when starting a scroll, after
that it just adds jumps when trying to scroll back and forth.

4 years agoMerge branch 'matthiasc/for-master' into 'master'
Matthias Clasen [Tue, 6 Jul 2021 00:23:30 +0000 (00:23 +0000)]
Merge branch 'matthiasc/for-master' into 'master'

gtk-demo: Add a slider to the menu example

See merge request GNOME/gtk!3733

4 years agogtk-demo: Add a slider to the menu example
Matthias Clasen [Mon, 5 Jul 2021 23:31:54 +0000 (19:31 -0400)]
gtk-demo: Add a slider to the menu example

This is a fun way to show that we can scale fast.

4 years agoMerge branch 'js-example' into 'master'
Matthias Clasen [Mon, 5 Jul 2021 20:24:30 +0000 (20:24 +0000)]
Merge branch 'js-example' into 'master'

Add a simple Javascript example

See merge request GNOME/gtk!3731

4 years agoMerge branch 'wip/remove-cloudprint' into 'master'
Matthias Clasen [Mon, 5 Jul 2021 20:21:52 +0000 (20:21 +0000)]
Merge branch 'wip/remove-cloudprint' into 'master'

Remove Google Cloud Print backend

See merge request GNOME/gtk!3729